package com.example.client.handler;

import com.example.commons.handler.MsgHandler;
import com.example.commons.handler.AbstractMsgHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * 业务消息处理
 *
 * @author cdw
 */
@Slf4j
@MsgHandler
public class BizMsgHandler extends AbstractMsgHandler<String, String> {

    @Override
    public String execute(String req) {
        // TODO　业务处理
        // 模拟阻塞
        if ("1".equalsIgnoreCase(req)) {
            try {
                Thread.sleep(5000L);
            } catch (InterruptedException ignored) {
            }
        }
        log.info("业务处理 req={}", req);
        return "＠　hello " + req;
    }
}
